// 创建初始状态，并导出一个函数
const defaultState = {
    updataInfo:"false",
    cusInfo:{},
}
// eslint-disable-next-line
// 导出一个函数
// eslint-disable-next-line
const cusreducer = (state=defaultState,action) => {
    let customerInfo = JSON.parse(JSON.stringify(state))
    const {type,data} = action
    switch(type){
        case "upCusInfo":
            customerInfo.updataInfo = "true"
            customerInfo.cusInfo = data;
            break
        case "newAddCus":
            customerInfo.updataInfo = "false"
            customerInfo.cusInfo = {}
            break
        default :
        customerInfo.updataInfo = "false"
        customerInfo.cusInfo = {};
    }
    return customerInfo
}
export default cusreducer
